levels(cuisine$Age) <- c("+ 50 years old", "18-25 years old", "26-35 years old", "36-50 years old")
colnames(cuisine)[2]="Sex"
levels(cuisine$frequency.cooking) <- c("everyday", "once a week", "sometimes")
colnames(cuisine)[7:11]=c("cooking.habit", "cooking.please.others", "cooking.no.choice", "cooking.enjoy.myself", "cooking.other.reason")
colnames(cuisine)[12:16]=c("cooking.synonym.tradition", "cooking.synonym.meal.with.family", "cooking.synonym.discovery", "cooking.synonym.innovation", "cooking.synonym.know.how")
levels(cuisine$equipment) <- c("bad equiped", "quite bas equiped", "average", "quite well equiped", "well equiped")
colnames(cuisine)[18]="would.like.to.receive.sth.related.to.cooking"
colnames(cuisine)[19]="cooking.budget"
cuisine$cooking.budget <- factor(cuisine$cooking.budget, labels=c("very low", "low", "average", "high", "very high"))
colnames(cuisine)[20]="shopping.brand"
colnames(cuisine)[22]="type.command.restaurant"
colnames(cuisine)[23]="looking.for.new.recipe"
colnames(cuisine)[24]="meal.aspect.matters"
levels(cuisine$meal.aspect.matters) <- c("disagree", "sligthly disagree", "neither agree nor disagree", "slightly agree", "agree")
colnames(cuisine)[25]="can.define.molecular.cooking"
colnames(cuisine)[26]="ever.heard.about.Herve.This"
colnames(cuisine)[27]="know.reaction.of.beaten.egg.white"
colnames(cuisine)[28]="use.ingredients.molecular.cooking"
cuisine$use.ingredients.molecular.cooking <- factor(cuisine$use.ingredients.molecular.cooking, labels=c("never", "rarely", "sometimes", "often"))
colnames(cuisine)[31:34]=c("interest.for.technique", "interest.for.mixture", "interest.for.originality", "interest.for.other")
colnames(cuisine)[35:43]=c("associated.to.gastronomy", "associated.to.chemistry", "associated.to.toxic", "associated.to.innovation", "associated.to.greedy", "associated.to.research", "associated.to.unknown", "associated.to.impressive", "associated.to.other")
colnames(cuisine)[45:47]=c("molecular.cooking.inspires.digust", "molecular.cooking.fashion.effect", "molecular.cooking.weird")

library(FactoMineR)
library(dynGraph)
library(EnQuireR)

summary(cuisine)

#MCA
cuisine.MCA<-cuisine[, c("frequency.cooking", "length.cooking", 
  "cooking.habit", "cooking.please.others", "cooking.no.choice", "cooking.enjoy.myself","cooking.other.reason", 
  "cooking.synonym.tradition", "cooking.synonym.meal.with.family", "cooking.synonym.discovery", "cooking.synonym.innovation", "cooking.synonym.know.how",
   "equipment", "would.like.to.receive.sth.related.to.cooking", "cooking.budget", "shopping.brand", "frequency.restaurant", 
  "type.command.restaurant", "looking.for.new.recipe", "meal.aspect.matters", "can.define.molecular.cooking",
   "ever.heard.about.Herve.This", "know.reaction.of.beaten.egg.white", "use.ingredients.molecular.cooking", "already.tasted", 
  "interested.molecular.cooking", "interest.for.technique", "interest.for.mixture", "interest.for.originality", "interest.for.other", "associated.to.gastronomy", 
  "associated.to.chemistry", "associated.to.toxic", "associated.to.innovation", "associated.to.greedy", "associated.to.research", "associated.to.unknown", "associated.to.impressive", 
  "associated.to.other", "feel.like.tasting", "molecular.cooking.inspires.digust", "molecular.cooking.fashion.effect", "molecular.cooking.weird", "feel.like.cooking", "Age", 
  "Sex", "SPC", "situation")]

res<-MCA(cuisine.MCA, ncp=5, quali.sup=45:48, level.ventil=0.05, graph = FALSE)
plot.MCA(res, axes=c(1, 2), col.ind="black", col.ind.sup="blue", 
  col.var="darkred", col.quali.sup="darkgreen", label=c("ind.sup", 
  "quali.sup", "var", "quanti.sup"), invisible=c("ind"), title="")
plot.MCA(res, axes=c(1, 2), choix="var", col.var="darkred", 
  col.quali.sup="darkgreen", label=c("quali.sup", "var"), invisible=c(""), 
  title="")


#dimensions description
dimdesc(res, axes=1:2)

#Hierarchical clustering
res.hcpc = HCPC(res)
res.hcpc$desc.var

#dynGraph
dynGraph(res)

#EnQuireR
res.enmca = ENMCA(cuisine.MCA, quali.sup=45:48, level.ventil=0.05, report=TRUE)